package com.qingke.Qiximybatis.command;

import com.qingke.Qiximybatis.sqlclass.MyUser;

public abstract class CommandFactory {
	
	public static enum CommandCode{
		//system
		EXIT,
		HELP,
		LOGIN,
		REGISTER,
		
		//User
		LISTUSER,
		UPDATE,
		INCREASE,
		INTEREST_UPDATE,
		SCHOOLSYSTEM,
		UPDATESTUDENT,
		SELECT_BEAUTY,
		A_PERSONAL_INVITATION,
		MANY,
		SELECT_MAN,
		INVITATION_INFORMATION,
		INFORMATION_TO_BE_INVITED
	}
	public static CommandFactory getFactory(MyUser user){
		if(user == null){
			return new SystemCommandFactory();
		}
		return new UserCommandFactory(user);
	}
	
	public abstract Command buildCommand(CommandCode cmdCode);//抽象只有被继承才有意义
	
}
